# @Time    :2025/8/11 下午4:42
# @Author  :XiaoJiang
# @File    :多对多查询.py
# @Software: PyCharm
import os



if __name__ == '__main__':
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Django_tushuguanli_demo.settings')
    import django
    django.setup()

    from app.models import Book,Press,BookType

    #booktype = BookType.objects.get(id=1)
    # book = Book.objects.get(id=4)
    # print(book.booktype_set.all())

    book = Book.objects.filter(booktype__id=3)
    print(book)